package com.xiguanlezz.cn.consumer.proxy;

import java.lang.reflect.Proxy;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/11/12 12:33
 * @Description：JDK动态代理工厂类
 */
public class JdkProxyFactory<T> extends BaseProxyFactory<T> {

    @SuppressWarnings("unchecked")
    public <T> T getProxy(Class<T> proxyClazz) {
        return (T) Proxy.newProxyInstance(
                proxyClazz.getClassLoader(),
                new Class<?>[]{proxyClazz},
                objectProxy
        );
    }

}
